package com.guli.mall.pms.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.guli.common.constant.ProductAttrTypeEnum;
import com.guli.common.valid.QueryGroup;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import javax.validation.constraints.Null;

/**
 * 商品属性
 *
 * @author 罗俊华
 * @email 1007052116@qq.com
 * @date 2020-09-17 11:37:23
 */
/*@Getter
@Setter*/
@Data
@TableName("pms_attr")
@Slf4j
public class AttrEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 属性id
     */
    @TableId
    private Long attrId;
    /**
     * 属性名
     */
    private String attrName;
    /**
     * 是否需要检索[0-不需要，1-需要]
     */
    private Integer searchType;
    /**
     * 属性图标
     */
    @Null(groups = QueryGroup.class)
    private String icon;
    /**
     * 可选值列表[用逗号分隔]
     */
    @Null(groups = QueryGroup.class)
    private String valueSelect;
    /**
     * 属性类型[0-销售属性，1-基本属性，2-既是销售属性又是基本属性]
     */
    private Integer attrType;
    /**
     * 启用状态[0 - 禁用，1 - 启用]
     */
    private Long enable;
    /**
     * 所属分类
     */
    private Long catelogId;
    /**
     * 快速展示【是否展示在介绍上；0-否 1-是】，在sku中仍然可以调整
     */
    private Integer showDesc;

    /**
     * 是否支持多选[1：支持多选；0：只能单选]
     */
    private boolean selectMultiple;

/*	@Override
	public boolean equals(Object obj) {
		if(obj instanceof AttrEntity){
			AttrEntity a = (AttrEntity) obj;
			if(a.getAttrId().equals(getAttrId())){
				log.info(a.getAttrName()+" 与 "+getAttrName()+"相等");
				return true;
			}else{
				log.warn(a.getAttrName()+" 与 "+getAttrName()+"不相等");
			}
		}
		if(obj instanceof AttrAttrgroupRelationEntity){
			AttrAttrgroupRelationEntity a = (AttrAttrgroupRelationEntity) obj;

			if(a.getAttrId().equals(getAttrId())){
				if(a.getAttrId().equals(getAttrId())){
					log.info(a.getAttrId()+" 与 "+getAttrName()+"相等");
					return true;
				}else{
					log.warn(a.getAttrId()+" 与 "+getAttrName()+"不相等");
				}
			}
		}
		return false;
	}*/
}
